Repository navigation
refactor!: deprecation cycle - #1128
Conversation
…ecation levels, standardize parameter naming for consistency (`inputStream` to `input`, `outputStream` to `output`), and remove obsolete APIs.
There was a problem hiding this comment.
🟢 Approval recommended
The scoped API changes and migrated usages match the documented deprecation plan, with no unresolved blocking findings.
No open issues 🎉
What changed in this PR
Advances the Kotlin SDK’s deprecation cycle and migrates internal usages and examples to supported APIs.
Changes:
- Raises legacy APIs to
ERRORand hides the old stdio constructor. - Removes the deprecated stateless HTTP overload and updates API snapshots.
- Updates examples, DSL construction, and compatibility-test suppression.
| File | Description |
|---|---|
| samples/weather-stdio-server/src/main/kotlin/io/modelcontextprotocol/sample/server/McpWeatherServer.kt | Uses current stdio argument names. |
| samples/kotlin-mcp-server/src/main/kotlin/io/modelcontextprotocol/sample/server/server.kt | Migrates stdio constructor arguments. |
| README.md | Updates stdio and sampling examples. |
| kotlin-sdk-server/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServerTransport.kt | Escalates legacy API deprecations. |
| kotlin-sdk-server/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/StdioServerTransport.kt | Hides the legacy constructor. |
| kotlin-sdk-server/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/KtorServer.kt | Removes the deprecated stateless overload. |
| kotlin-sdk-server/api/kotlin-sdk-server.klib.api | Records the removed overload. |
| kotlin-sdk-server/api/kotlin-sdk-server.api | Records JVM API changes. |
| kotlin-sdk-core/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/types/ElicitationTest.kt | Updates compatibility-test suppression. |
| kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/elicitation.kt | Escalates legacy elicitation deprecations. |
| kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/elicitation.dsl.kt | Uses the supported form-parameters constructor. |
| kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/capabilities.kt | Escalates the legacy capabilities constructor deprecation. |
| kotlin-sdk-client/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/client/StreamableHttpMcpKtorClientExtensions.kt | Escalates legacy reconnection overload deprecations. |
| kotlin-sdk-client/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/client/StreamableHttpClientTransport.kt | Escalates the legacy transport constructor deprecation. |
Review effort: Balanced
There was a problem hiding this comment.
Looks good — the deprecation cycle is consistent and everything checks out, happy to approve!
Produced by Air Automations. Name: Code review / Run: https://air.jetbrains.cloud/org/05cf1a7f-6ab5-713b-abd3-29d0c8a05e2d/automations/409567ec-d3a7-40ac-ba95-8518ec577ac2?run=f8e7b782-8ea4-4dfc-b1d8-7b34d38ea1f3
There was a problem hiding this comment.
All green on my end — happy to approve, with one non-blocking note inline for you to consider.
Produced by Air Automations. Name: Code review / Run: https://air.jetbrains.cloud/org/05cf1a7f-6ab5-713b-abd3-29d0c8a05e2d/automations/409567ec-d3a7-40ac-ba95-8518ec577ac2?run=527bcd77-4b6f-496e-a26b-be3afc38701a
| @Deprecated( | ||
| "Use mcpStatelessStreamableHttp without eventStore.", | ||
| ReplaceWith("mcpStatelessStreamableHttp(path, enableDnsRebindingProtection, allowedHosts, allowedOrigins, block)"), | ||
| DeprecationLevel.ERROR, |
There was a problem hiding this comment.
Problem: the eventStore overload goes straight from ERROR to deleted, so the JVM method and the klib symbol disappear in a single release. StdioServerTransport(inputStream, outputStream) in this same PR is deliberately parked at HIDDEN for exactly that reason; this one skips that step.
Failure scenario: an app depends on a library compiled against 0.14.0 that calls mcpStatelessStreamableHttp(path, …, eventStore = store, block). The app bumps kotlin-sdk-server to the next release without recompiling that library. Nothing fails at compile time — route registration throws NoSuchMethodError the first time it runs.
Suggested fix: keep the declaration one more release with level = DeprecationLevel.HIDDEN and the body unchanged (it already delegates to the supported overload). That removes it from source resolution while leaving the method and klib symbol in place, then delete it in the release after.
There was a problem hiding this comment.
All clear on my side — the deprecation cycle looks consistent and everything builds and passes, happy to approve!
Produced by Air Automations. Name: Code review / Run: https://air.jetbrains.cloud/org/05cf1a7f-6ab5-713b-abd3-29d0c8a05e2d/automations/409567ec-d3a7-40ac-ba95-8518ec577ac2?run=5e2435a1-c0ce-4a13-8787-312c7a31ffd2
Raises the level of APIs deprecated in 0.9.0–0.13.0 and removes the
mcpStatelessStreamableHttpoverload that has beenERRORsince 0.15.0.ERROR:StreamableHttpServerTransport(),StreamableHttpServerTransport(enableJsonResponse, …)StreamableHttpClientTransport,mcpStreamableHttpTransport,mcpStreamableHttpwithreconnectionTimeElicitRequest.requestedSchema,ElicitRequestParams(message, requestedSchema, meta)ClientCapabilities(sampling: JsonObject?, …)Configuration.enableDnsRebindingProtection,allowedHosts,allowedOriginsHIDDEN:StdioServerTransport(inputStream, outputStream). WithERROR, a positionalStdioServerTransport(input, output)would resolve to it and stop compiling.LegacyTitledEnumSchemastays atWARNINGwhile the spec still lists it.How Has This Been Tested?
JVM compilation of all modules with tests;
ElicitationTest,ElicitationDslTest,StreamableHttpServerTransportTest; README (knit) and samples compile; ktlint, detekt,checkKotlinAbi.Breaking Changes
ERRORAPIs no longer compiles; existing binaries keep working.StdioServerTransport(inputStream = …, outputStream = …): rename the arguments toinputandoutput.mcpStatelessStreamableHttp: binaries built against 0.14.0 or earlier fail withNoSuchMethodError; recompile.Types of changes
Checklist